<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../print.css" type="text/css" media="print">
<meta content="ObjectUtil,jp.raohmaru.utils.ObjectUtil,attachMovie,clone,cloneElement,duplicateDisplayObject,getChildren,getChildrenByType,hideAndRemove,removeAllChildren,unloadAllChildren" name="keywords">
<title>jp.raohmaru.utils.ObjectUtil</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'ObjectUtil - Raohmaru AS3 Framework';
				var baseRef = '../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Raohmaru AS3 

Framework</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../all-classes.html')" href="../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../index-list.html')" href="../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../index.html?jp/raohmaru/utils/ObjectUtil.html&amp;jp/raohmaru/utils/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;ObjectUtil</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class ObjectUtil"); titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">jp.raohmaru.utils</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class ObjectUtil</td>
</tr>
</table>
<p></p>
 Métodos extendidos para el tratamiento de objetos y objetos de visualización.
 <p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#attachMovie()">attachMovie</a>(name:String):DisplayObject</div>
<div class="summaryTableDescription">[static]
  Crea una nueva instancia del objeto con el nombre de clase especificada como parámetro.</div>
</td><td class="summaryTableOwnerCol">ObjectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#clone()">clone</a>(source:Object):*</div>
<div class="summaryTableDescription">[static]
  Clona un objeto que no sea un DisplayObject.</div>
</td><td class="summaryTableOwnerCol">ObjectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#cloneElement()">cloneElement</a>(element:Object):Object</div>
<div class="summaryTableDescription">[static]
  Crea una nueva instancia de una clase a partir de otra.</div>
</td><td class="summaryTableOwnerCol">ObjectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#duplicateDisplayObject()">duplicateDisplayObject</a>(target:DisplayObject, autoAdd:Boolean = false):DisplayObject</div>
<div class="summaryTableDescription">[static]
  Duplica un DisplayObject de manera similar a duplicateMovieClip en AVM1.</div>
</td><td class="summaryTableOwnerCol">ObjectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getChildren()">getChildren</a>(container:DisplayObjectContainer):Array</div>
<div class="summaryTableDescription">[static]
  Obtiene una matriz con todos los nodos secundarios del objeto DisplayObjectContainer especificado.</div>
</td><td class="summaryTableOwnerCol">ObjectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getChildrenByType()">getChildrenByType</a>(container:DisplayObjectContainer, type:Class):Array</div>
<div class="summaryTableDescription">[static]
  Obtiene una matriz con todos los nodos secundarios del tipo especificado de un objeto DisplayObjectContainer.</div>
</td><td class="summaryTableOwnerCol">ObjectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#hideAndRemove()">hideAndRemove</a>(target:DisplayObject, time:Number = .3, delay:Number = 0):void</div>
<div class="summaryTableDescription">[static]
  Oculta y remueve de la lista de visualización un DisplayObject.</div>
</td><td class="summaryTableOwnerCol">ObjectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#removeAllChildren()">removeAllChildren</a>(container:DisplayObjectContainer):Array</div>
<div class="summaryTableDescription">[static]
  Elimina todos los elementos secundarios de una instancia DisplayObjectContainer y devuelve una matriz con esos elementos.</div>
</td><td class="summaryTableOwnerCol">ObjectUtil</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#unloadAllChildren()">unloadAllChildren</a>(container:DisplayObjectContainer):void</div>
<div class="summaryTableDescription">[static]
  Elimina todos los elementos secundarios de los objetos Loader del contenedor DisplayObjectContainer que se cargaron
  utilizando el método <code>load()</code>.</div>
</td><td class="summaryTableOwnerCol">ObjectUtil</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="attachMovie()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">attachMovie</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public static function attachMovie(name:String):DisplayObject</code><p>
  Crea una nueva instancia del objeto con el nombre de clase especificada como parámetro.
  Es un atajo a vincular una clase con <code>new ClassReference()</code>, pero al estilo del viejo AS2.
  FIXME No funciona en una pelicula cuando esta se carga como .swf externo en otra película
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">name</span>:String</code> &mdash; Nombre de la clase del objeto a instanciar.
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>DisplayObject</code> &mdash; Una instancia del objeto vinculado.
  </td>
</tr>
</table>
</div>
<a name="clone()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">clone</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function clone(source:Object):*</code><p>
  Clona un objeto que no sea un DisplayObject. No guarda referencias a instancias específicas.
  Es mejor utilizar este método para objetos sencillos.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">source</span>:Object</code> &mdash; Objeto a clonar
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>*</code> &mdash; Nuevo objeto
  </td>
</tr>
</table>
</div>
<a name="cloneElement()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">cloneElement</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function cloneElement(element:Object):Object</code><p>
  Crea una nueva instancia de una clase a partir de otra.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">element</span>:Object</code> &mdash; Objeto cuya clase se clonará
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Object</code> &mdash; Nuevo objeto clon
  </td>
</tr>
</table>
</div>
<a name="duplicateDisplayObject()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">duplicateDisplayObject</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function duplicateDisplayObject(target:DisplayObject, autoAdd:Boolean = false):DisplayObject</code><p>
  Duplica un DisplayObject de manera similar a duplicateMovieClip en AVM1.
  <b>IMPORTANTE</b> El símbolo del movieclip duplicado debe estar exportado para ActionScript en la biblioteca.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">target</span>:DisplayObject</code> &mdash; DisplayObject a duplicar
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">autoAdd</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; Determina si se añade el objeto duplicado a la lista de visualización a la que pertenece el objeto original
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>DisplayObject</code> &mdash; Una instancia del objeto duplicado
  </td>
</tr>
</table>
</div>
<a name="getChildren()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getChildren</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getChildren(container:DisplayObjectContainer):Array</code><p>
  Obtiene una matriz con todos los nodos secundarios del objeto DisplayObjectContainer especificado.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">container</span>:DisplayObjectContainer</code> &mdash; Objeto contenedor de donde obtener los hijos.
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code> &mdash; Una matriz con todos los nodos secundarios.
  </td>
</tr>
</table>
</div>
<a name="getChildrenByType()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getChildrenByType</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function getChildrenByType(container:DisplayObjectContainer, type:Class):Array</code><p>
  Obtiene una matriz con todos los nodos secundarios del tipo especificado de un objeto DisplayObjectContainer.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">container</span>:DisplayObjectContainer</code> &mdash; Objeto contenedor de donde obtener los hijos.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">type</span>:Class</code> &mdash; Class La clase o tipo al que deben pertenecer los nodos secundarios.
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code> &mdash; Una matriz con todos los nodos secundarios.
  </td>
</tr>
</table>
<br>
<span class="label">Example</span>
<br>  <div class='listing'><pre>
  import jp.raohmaru.utils.ObjectUtil;
  
  addChild(new Sprite());
  addChild(new Sprite());
  addChild(new Bitmap());
  
  trace( ObjectUtil.getChildrenByType(this, Sprite).length );  // 2
  trace( ObjectUtil.getChildrenByType(this, Bitmap).length );   // 1
  </pre></div>
  <p></p>
</div>
<a name="hideAndRemove()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">hideAndRemove</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function hideAndRemove(target:DisplayObject, time:Number = .3, delay:Number = 0):void</code><p>
  Oculta y remueve de la lista de visualización un DisplayObject.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">target</span>:DisplayObject</code> &mdash; Objeto DisplayObject a ocultar y eliminar.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">time</span>:Number</code> (default = <code>.3</code>)<code></code> &mdash; Duración de la transición en segundos.
  </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">delay</span>:Number</code> (default = <code>0</code>)<code></code> &mdash; Retraso en el inicio de la transición, en segundos.
  </td>
</tr>
</table>
</div>
<a name="removeAllChildren()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">removeAllChildren</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function removeAllChildren(container:DisplayObjectContainer):Array</code><p>
  Elimina todos los elementos secundarios de una instancia DisplayObjectContainer y devuelve una matriz con esos elementos.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">container</span>:DisplayObjectContainer</code> &mdash; El contenedor a vaciar
  </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code> &mdash; Matriz con los elementos elminiados
  </td>
</tr>
</table>
</div>
<a name="unloadAllChildren()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">unloadAllChildren</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public static function unloadAllChildren(container:DisplayObjectContainer):void</code><p>
  Elimina todos los elementos secundarios de los objetos Loader del contenedor DisplayObjectContainer que se cargaron
  utilizando el método <code>load()</code>.
  </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">container</span>:DisplayObjectContainer</code> &mdash; El contenedor a vaciar
  </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">Loader.load()</div>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">http://www.raohmaru.com</center>
</div>
</body>
</html>
<!--http://www.raohmaru.com-->
